
#pragma once
#include "stdafx.h"
#include "ui_script_editor.h"
#include "common.h"
class Common;

class ScriptEditor : public QDialog
{
	Q_OBJECT
private:
	Ui::ScriptEditorDialog ui;
	vector<QString> description;
public:
	ScriptEditor(QWidget* pwgt = 0);
	
	void setData(const vector<pair<QString, QString>> &script_list, const  QString &current_script);
	vector<pair<QString, QString>> getScriptList();
	QString getCurrentScript();
	bool isUniqueName(const QString &name, const int &index = -1);
private slots:
	void on_bAccept_clicked();
	void on_bReject_clicked();
	void on_bAdd_clicked();
	void on_bEdit_clicked();
	void on_bRemove_clicked();
	void on_bUp_clicked();
	void on_bDown_clicked();
	void on_bUse_clicked();
	void displayDescription(int index);	
};

